<!-- doUserReg.php 用于将用户输入的注册信息添加到数据库。 -->
<?php
  
  require_once('system/dbConn.php');
  require_once('system/myFunc.php');
  //连接数据库		
  connect();

  if(!empty($_FILES["xjn_pic"]["name"])){
  	$xjn_pic = uploadfile('xjn_pic','./upload/',array('jpg','gif','png'));
  }
  else{
  	$xjn_pic='';
  }

  $data = array(
		'xjn_title' => trim($_POST['xjn_title']),  
		'xjn_place' => $_POST['xjn_place'],
		'xjn_intro' => $_POST['xjn_intro'],
		'xjn_adddate' => $_POST['xjn_adddate'],
		'xjn_hint' => $_POST['xjn_adddate'],
		'xjn_pic'=>$xjn_pic
  	);

  //执行SQL语句
	$result = add('flower',$data);

  if(!$result){
  	echo "注册失败！<br/>";
  	echo "<a href='flowerreg.html'>返回</a>";	  
  }else{	  
 	echo "注册成功！";
	echo "或返回<a href='flowerlist.php'>鲜花列表</a>页面！";	  
  }    
  
?>